// 改变推荐商品
export const changeRecommend = (data, target, m, n) => {
    target.splice(0, target.length)
    for (let i = 0; i < 10; i++) {
        let random = Math.ceil(Math.random() * (n - m + 1) + m - 1)
        target.push(data[random])
    }
}

// 防抖函数
export const debounce = (fn, wait) => {
    let timer = null
    return function () {
        if (timer !== null) {
            clearTimeout(timer)
        }
        timer = setTimeout(fn, wait)
    }
}
